<div class="props-top">
    <ul class="pro-nav-tabs j-nav-props clearfix" id="J_User_Props">
        <li class="on"><a href="/member/user/my_mounts">座驾</a></li>
        <li><a href="/member/user/my_vip">VIP</a></li>
    </ul>
</div>
<div class="clearfix">
    <div class="main-container">
        <div class="props-conts">
            <ul class="props-list-motoring j-props-list" id="J_User_MountINFO">
            </ul>
        </div>
    </div>
</div>
<script>
    $(function () {
        if (!_StateData.IsLogin) {
            $.KOC.Tips.Open('Error', '请先登录', {Timeout: 1000});
            location.href = '/';
        }
        var _html = ''
        if (!_PageData.MountsList) {
            _html += '<li>' +
                    '<p>您还没有座驾!</p>' +
                    '</li>';
        } else {
            _.forEach(_PageData.MountsList, function (ThisValue, n) {
                if (ThisValue.Mounts_ID == _PageData.Mounts_ID) {
                    _html += '<li>' +
                            '<p class="prpps-img">' +
                            '<img src="' + _VirtualPath.Static + '/main/image/mount/car' + ThisValue.Mounts_ID + '.png"/>' +
                            '</p>' +
                            '<div class="clearfix">' +
                            '<p class="prpps-name">' + ThisValue.Mounts_Name + '</p>' +
                            '<p class="prpps-state">剩余 <i>' + ThisValue.Mounts_ExpireDay + '</i> 天</p>' +
                            '</div>' +
                            '<p class="prpps-btn">' +
                            '<input name="Mount_Id" value="' + ThisValue.Mounts_ID + '" type="hidden">' +
                            '<a href="javascript:;" class="gsale-btn gsale-btn-4 J-use-mount use" >使用中</a>' +
                            '<a href="/mall/motoring" class="gsale-btn gsale-btn-2">续费</a>' +
                            '</p>' +
                            '</li>';
                } else {
                    _html += '<li>' +
                            '<p class="prpps-img">' +
                            '<img src="' + _VirtualPath.Static + '/main/image/mount/car' + ThisValue.Mounts_ID + '.png"/>' +
                            '</p>' +
                            '<div class="clearfix">' +
                            '<p class="prpps-name">' + ThisValue.Mounts_Name + '</p>' +
                            '<p class="prpps-state">剩余 <i>' + ThisValue.Mounts_ExpireDay + '</i> 天</p>' +
                            '</div>' +
                            '<p class="prpps-btn">' +
                            '<input name="Mount_Id" value="' + ThisValue.Mounts_ID + '" type="hidden">' +
                            '<a href="javascript:;" class="gsale-btn gsale-btn-1 J-use-mount " >使用</a>' +
                            '<a href="/mall/motoring" class="gsale-btn gsale-btn-2">续费</a>' +
                            '</p>' +
                            '</li>';
                }
            })
        }
        $('#J_User_MountINFO').empty().html(_html);
        $("#J_User_MountINFO").on("click", ".J-use-mount", function (e) {
            var Mount_ID = $(this).siblings('input[name="Mount_Id"]').val();
            if ($(this).hasClass("use")) {
                $(this).addClass("gsale-btn-1").removeClass('use gsale-btn-4').text("使用");
                $.CommonMain.User_MountsUpdate(-1);
            } else {
                $(this).addClass('use gsale-btn-4').removeClass('gsale-btn-1').text('使用中').parents('li').siblings().find('.J-use-mount').removeClass('use gsale-btn-4').text('使用');
                $.CommonMain.User_MountsUpdate(Mount_ID);//取消使用
            }
        })
//        $('#J_User_Mount_Is').on('click', function () {
//
//            $.CommonMain.User_MountsUpdate(_PageData.RoomID); //添加关注
//        })
    });
</script>